<!DOCTYPE html>
<!-- saved from url=(0038)http://v3.bootcss.com/examples/signin/ -->
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="__PUBLIC__/Home/image/djwy.ico" />

    <title>DZ.DJWY Sign In</title>

    <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/Admin/login/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="__PUBLIC__/Admin/login/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/Admin/login/signin.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="__PUBLIC__/Admin/login/hm.js"></script><script src="__PUBLIC__/Admin/login/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        body{
            background: url(__PUBLIC__/admin/login/2.jpg) no-repeat 0px -80px;
            font-family: 'Open Sans', sans-serif;
            background-size:cover;
            -webkit-background-size:cover;
            -moz-background-size:cover;
            -o-background-size:cover;
            height:100%;
          }
        .alert-danger{
          position:absolute;
          z-index:1;
          width:20.8%;
          display:none;
        }
    </style>
  </head>

  <body>
    <?php 
        /*$h = hash("sha512",'12345');echo $h,"<br>";
        echo md5('12345'); echo "<br>";
        echo md5(uniqid(rand(), true));echo "<br>";
        $hash = password_hash('bbt123456',PASSWORD_DEFAULT);
        $h = password_hash('bbt123456',PASSWORD_BCRYPT);
        echo $hash;echo '<br>',$h;
        var_dump(password_verify('bbt123456',$hash));*/

     ?>
      
        
      

    <div class="container">
      
        <form class="form-signin" action="__URL__/checkLogin" method="post">
          <center>
            <div class="alert alert-danger alert-dismissable">
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
              <span>非工作人员！***. </span>
            </div>
          </center>
          <!-- alert-danger    end -->
          <h2 class="form-signin-heading">　DZ.DJWY Sign In </h2>
          <label for="inputEmail" class="sr-only">管理员账号</label>
          <input type="text" name='username' id="inputEmail" class="form-control" placeholder="管理员账号" required="" autofocus="">
          
          <label for="inputPassword" class="sr-only">Password</label>
          <input type="password" id="inputPassword" name='password' class="form-control" placeholder="Password" required="">
          
          <label for="inputcode" class="sr-only">验证码</label>
          <input id="inputcode" name='code' class="form-control" placeholder="验证码" required="" type="text">
          
          
          <img class='codeimg' src="__URL__/verify" alt=""   onclick="this.src='__URL__/verify'+'?'+Math.random()" />
          <div class='clear'></div>
           
          <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
        </form>
      
      </div> 
    <!-- /container -->

    

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="__PUBLIC__/Admin/login/ie10-viewport-bug-workaround.js"></script>
    <script src="__PUBLIC__/js/jquery-3.1.1.min.js"></script>

</body>
<script type="text/javascript">

$(function(){

    var CNAME = false;
    var CPASS = false;
    var CCODE = false;

    $('form').submit(function(){
      if(!CCODE){
        $('.alert-danger').css('display','block').find('span').html('验证码有误');
        if($('.alert-danger').is(':visible')){
          $('.alert-danger').fadeOut(6600);
        }
        return false;
      }

      if(CNAME && CPASS && CCODE){
        return true;
      }

      return false;

    })

    $('input[name=username]').blur(function(){
      var name = $(this).val();
      if(name){
        $.post('__URL__/check',{name:name},function(data){
          
          if(data['status']){
            // alert('ok')
            CNAME = true;
          }else{
            $('.alert-danger').css('display','block').find('span').html('非工作人员！***');
              if($('.alert-danger').is(':visible')){
                $('.alert-danger').fadeOut(6600);
              }
            CNAME = false;
            // alert('no')
          }
        },'json')
      }
    })

    $('input[name=password]').blur(function(){
      var pass = $(this).val();
      if(pass){
       
        CPASS = true;
      }else{
        CPASS = false;
      }
    })

    $('input[name=code]').blur(function(){
      var code = $(this).val();
      $.post('__URL__/check',{code:code},function(data){
        if(data['status']){
          CCODE = true;
        }else{
          CCODE = false;
        }
      },'json')

    })

    //关闭denger
    $('.close').click(function(){
      $('.alert-danger').css('display','none');
    })

})
</script>
</html>